Initializes a new instance of StitchCommand with given properties.
public StitchCommand(
List<RasterImage> toStitchImages,
StitchSideMatchingType sideMatchingType,
StitchMethodType methodType,
StitchImageType imageType,
double minimumOverlap,
LeadRect stitchArea
)
public:
StitchCommand( List<RasterImage^>^ toStitchImages, StitchSideMatchingType^ sideMatchingType, StitchMethodType^ methodType, StitchImageType^ imageType, double minimumOverlap, LeadRect^ stitchArea)
__init__(self,toStitchImages,sideMatchingType,methodType,imageType,minimumOverlap,stitchArea) # Overloaded constructor
toStitchImages
List of RasterImages to stitch together.
sideMatchingType
The side of each image to stitch.
methodType
The method of stitching.
imageType
The flag specifying the image type.
minimumOverlap
The minimum overlap threshold for each image to stitch.
stitchArea
The area for each RasterImage to stitch.
To perform stitching using the default settings, pass null to the parameters other than toStitchImages.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Effects;
public void StitchCommandExample()
{
IList<RasterImage> Images = new List<RasterImage>();
RasterCodecs codecs = new RasterCodecs();
// Load images
for (int i = 1; i <= 4; i++)
{
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, $"cannon{i}.jpg"));
Images.Add(image);
}
// The first image to stitch together
var firstImage = Images.First();
try
{
var toStitchImages = Images.Skip(1).ToList();
try
{
// Create new Stitch Command and run on the provided images with the given parameters
// If successful, the firstImage will be updated to a stitched image
new StitchCommand
{
ImageType = StitchImageType.Picture,
ToStitchImages = toStitchImages,
MethodType = StitchMethodType.Exhaustive,
SideMatchingType = StitchSideMatchingType.KeepLeft,
MinimumOverlap = 0.0
}.Run(firstImage);
codecs.Save(firstImage, Path.Combine(LEAD_VARS.ImagesDir, "cannonStitched.jpg"), RasterImageFormat.Jpeg411, 24);
firstImage.Dispose();
codecs.Dispose();
Images.Clear();
}
catch (Exception e)
{
Assert.Fail(e.Message);
Console.WriteLine(e);
}
}
catch (Exception e)
{
Console.WriteLine(e);
Assert.Fail(e.Message);
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document